import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne,OneToMany,OneToOne,PrimaryColumn,PrimaryGeneratedColumn,RelationId} from "typeorm";
import {QrtzJobDetails} from "./QrtzJobDetails";
import {QrtzBlobTriggers} from "./QrtzBlobTriggers";
import {QrtzCronTriggers} from "./QrtzCronTriggers";
import {QrtzSimpleTriggers} from "./QrtzSimpleTriggers";
import {QrtzSimpropTriggers} from "./QrtzSimpropTriggers";


@Entity("QRTZ_TRIGGERS",{schema:"nest-mall" } )
@Index("IDX_QRTZ_T_J",["sChedName","jObName","jObGroup",])
@Index("IDX_QRTZ_T_JG",["sChedName","jObGroup",])
@Index("IDX_QRTZ_T_C",["sChedName","calendarName",])
@Index("IDX_QRTZ_T_G",["sChedName","triggerGroup",])
@Index("IDX_QRTZ_T_STATE",["sChedName","triggerState",])
@Index("IDX_QRTZ_T_N_STATE",["sChedName","triggerName","triggerGroup","triggerState",])
@Index("IDX_QRTZ_T_N_G_STATE",["sChedName","triggerGroup","triggerState",])
@Index("IDX_QRTZ_T_NEXT_FIRE_TIME",["sChedName","nextFireTime",])
@Index("IDX_QRTZ_T_NFT_ST",["sChedName","triggerState","nextFireTime",])
@Index("IDX_QRTZ_T_NFT_MISFIRE",["sChedName","misfireInstr","nextFireTime",])
@Index("IDX_QRTZ_T_NFT_ST_MISFIRE",["sChedName","misfireInstr","nextFireTime","triggerState",])
@Index("IDX_QRTZ_T_NFT_ST_MISFIRE_GRP",["sChedName","misfireInstr","nextFireTime","triggerGroup","triggerState",])
export class QrtzTriggers {

   
    @ManyToOne(type=>QrtzJobDetails, qRTZ_JOB_DETAILS=>qRTZ_JOB_DETAILS.qRtzTriggerSs,{ primary:true, nullable:false,onDelete: 'RESTRICT',onUpdate: 'RESTRICT' })
    @JoinColumn({ name:'SCHED_NAME'})
    sChedName:QrtzJobDetails | null;


    @Column("varchar",{ 
        nullable:false,
        primary:true,
        length:200,
        name:"TRIGGER_NAME"
        })
    triggerName:string;
        

    @Column("varchar",{ 
        nullable:false,
        primary:true,
        length:200,
        name:"TRIGGER_GROUP"
        })
    triggerGroup:string;
        

   
    @ManyToOne(type=>QrtzJobDetails, qRTZ_JOB_DETAILS=>qRTZ_JOB_DETAILS.qRtzTriggerSs2,{  nullable:false,onDelete: 'RESTRICT',onUpdate: 'RESTRICT' })
    @JoinColumn({ name:'JOB_NAME'})
    jObName:QrtzJobDetails | null;


   
    @ManyToOne(type=>QrtzJobDetails, qRTZ_JOB_DETAILS=>qRTZ_JOB_DETAILS.qRtzTriggerSs3,{  nullable:false,onDelete: 'RESTRICT',onUpdate: 'RESTRICT' })
    @JoinColumn({ name:'JOB_GROUP'})
    jObGroup:QrtzJobDetails | null;


    @Column("varchar",{ 
        nullable:true,
        length:250,
        name:"DESCRIPTION"
        })
    description:string | null;
        

    @Column("bigint",{ 
        nullable:true,
        name:"NEXT_FIRE_TIME"
        })
    nextFireTime:string | null;
        

    @Column("bigint",{ 
        nullable:true,
        name:"PREV_FIRE_TIME"
        })
    prevFireTime:string | null;
        

    @Column("int",{ 
        nullable:true,
        name:"PRIORITY"
        })
    priority:number | null;
        

    @Column("varchar",{ 
        nullable:false,
        length:16,
        name:"TRIGGER_STATE"
        })
    triggerState:string;
        

    @Column("varchar",{ 
        nullable:false,
        length:8,
        name:"TRIGGER_TYPE"
        })
    triggerType:string;
        

    @Column("bigint",{ 
        nullable:false,
        name:"START_TIME"
        })
    startTime:string;
        

    @Column("bigint",{ 
        nullable:true,
        name:"END_TIME"
        })
    endTime:string | null;
        

    @Column("varchar",{ 
        nullable:true,
        length:200,
        name:"CALENDAR_NAME"
        })
    calendarName:string | null;
        

    @Column("smallint",{ 
        nullable:true,
        name:"MISFIRE_INSTR"
        })
    misfireInstr:number | null;
        

    @Column("blob",{ 
        nullable:true,
        name:"JOB_DATA"
        })
    jobData:Buffer | null;
        

   
    @OneToMany(type=>QrtzBlobTriggers, qRTZ_BLOB_TRIGGERS=>qRTZ_BLOB_TRIGGERS.sChedName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzBlobTriggerSs:QrtzBlobTriggers[];
    

   
    @OneToMany(type=>QrtzBlobTriggers, qRTZ_BLOB_TRIGGERS=>qRTZ_BLOB_TRIGGERS.tRiggerName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzBlobTriggerSs2:QrtzBlobTriggers[];
    

   
    @OneToMany(type=>QrtzBlobTriggers, qRTZ_BLOB_TRIGGERS=>qRTZ_BLOB_TRIGGERS.tRiggerGroup,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzBlobTriggerSs3:QrtzBlobTriggers[];
    

   
    @OneToMany(type=>QrtzCronTriggers, qRTZ_CRON_TRIGGERS=>qRTZ_CRON_TRIGGERS.sChedName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzCronTriggerSs:QrtzCronTriggers[];
    

   
    @OneToMany(type=>QrtzCronTriggers, qRTZ_CRON_TRIGGERS=>qRTZ_CRON_TRIGGERS.tRiggerName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzCronTriggerSs2:QrtzCronTriggers[];
    

   
    @OneToMany(type=>QrtzCronTriggers, qRTZ_CRON_TRIGGERS=>qRTZ_CRON_TRIGGERS.tRiggerGroup,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzCronTriggerSs3:QrtzCronTriggers[];
    

   
    @OneToMany(type=>QrtzSimpleTriggers, qRTZ_SIMPLE_TRIGGERS=>qRTZ_SIMPLE_TRIGGERS.sChedName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzSimpleTriggerSs:QrtzSimpleTriggers[];
    

   
    @OneToMany(type=>QrtzSimpleTriggers, qRTZ_SIMPLE_TRIGGERS=>qRTZ_SIMPLE_TRIGGERS.tRiggerName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzSimpleTriggerSs2:QrtzSimpleTriggers[];
    

   
    @OneToMany(type=>QrtzSimpleTriggers, qRTZ_SIMPLE_TRIGGERS=>qRTZ_SIMPLE_TRIGGERS.tRiggerGroup,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzSimpleTriggerSs3:QrtzSimpleTriggers[];
    

   
    @OneToMany(type=>QrtzSimpropTriggers, qRTZ_SIMPROP_TRIGGERS=>qRTZ_SIMPROP_TRIGGERS.sChedName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzSimpropTriggerSs:QrtzSimpropTriggers[];
    

   
    @OneToMany(type=>QrtzSimpropTriggers, qRTZ_SIMPROP_TRIGGERS=>qRTZ_SIMPROP_TRIGGERS.tRiggerName,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzSimpropTriggerSs2:QrtzSimpropTriggers[];
    

   
    @OneToMany(type=>QrtzSimpropTriggers, qRTZ_SIMPROP_TRIGGERS=>qRTZ_SIMPROP_TRIGGERS.tRiggerGroup,{ onDelete: 'RESTRICT' ,onUpdate: 'RESTRICT' })
    qRtzSimpropTriggerSs3:QrtzSimpropTriggers[];
    
}
